import java.text.SimpleDateFormat;
import java.util.Calendar;

import javax.swing.JLabel;


public class DigitaleUhr extends Thread {
	
	private JLabel lable;
	
	public DigitaleUhr(JLabel lable) {
		this.lable = lable;
	}
	
	public void run() {
	    while(!isInterrupted()) {
	    	Calendar cal = Calendar.getInstance();
	    	SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
	    	String strDate = sdf.format(cal.getTime());
	    	lable.setText(strDate);
	    	try {
				Thread.sleep(1000);
			} catch(InterruptedException e) {
				interrupt();
			}
	    }
	}

}
